package com.jackiechan.hello.day09;

/**
 * 使用线程方式二创建两个线程:分别输出1000次，你好和再见
 *
 * @author Xiloer
 */
public class Test02 {
    public static void main(String[] args) {
        MyThread2 myThread2 = new MyThread2();
        MyThread4 myThread4 = new MyThread4();
        Thread thread = new Thread(myThread2);
        Thread thread4 = new Thread(myThread4);
        thread.start();
        thread4.start();
    }
}

class MyThread2 implements Runnable {
    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println("你好");
        }
    }
}

class MyThread4 implements Runnable {
    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {

            System.out.println("再见");
        }
    }
}